!!! XML utf-8
!!! 1.1
%html{:xmlns => 'http://www.w3.org/1999/xhtml'}
  %head
    %link{:rel => 'shortcut icon', :href => '/favicon.ico', :type => 'image/x-icon'}
    %link{:rel => 'stylesheet', :href => '/style.css', :type => 'text/css'}
    %meta{'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8'}
    %title= article.gsub(/index$/, '')
  %body
    #path
      %a{:href => '/'} ciew/
      - p = '/'
      - ppath = article
      - ppath = File.dirname(article) unless File.directory?(path)
      - ppath.split('/').each do |node|
        - next if node == ''
        - p = p + node + '/'
        %a{:href => p}= node + '/'
    #menu
      %ul
        - wiki.menu(article).each do |entry|
          %li
            - if entry == File.basename(article)
              %a{:href => entry}
                %strong= entry
            - else
              %a{:href => entry}= entry
    - if action == 'view'
      #main.article= RedCloth.new(wiki.read(article)).to_html
    - if action == 'edit'
      #main.admin
        %h1
          %code= article
        %form{:action => article, :method => 'post'}
          #help
            %a{:href => 'http://hobix.com/textile/'} help
          #textarea
            %textarea{:name => 'text', :id => 'editor', :cols => '80', :rows => '20'}= CGI.escapeHTML(wiki.read(article))
          #password
            %input{:name => 'password', :type => 'password', :value => ''}
            %input{:name => 'action', :type => 'submit', :value => 'save'}
    - if action == 'archive'
      #main.admin
        %h1
          %code= article
        %form{:action => article, :method => 'post'}
          %input{:name => 'password', :type => 'password', :value => ''}
          %input{:name => 'action', :type => 'submit', :value => 'archive'}
    #admin
      %form{:action => article, :method => 'post'}
        %p
          %input{:accesskey => 'e', :name => 'action', :type => 'submit', :value => 'edit'}
          %input{:accesskey => 'a', :name => 'action', :type => 'submit', :value => 'archive'}
